import request from '@/utils/request'

export const ArrangeApi = {
  /**
     *  线路组分页列表
     * @returns
     */
  getPage: (data) => {
    return request({
      url: '/manage/intercity/arrange/getPage',
      data,
      method: 'post'
    })
  },

  /**
     *  取消班次
     * @returns
     */
  cancelArrange: (arrangeCode) => {
    return request({
      url: '/manage/intercity/arrange/cancelArrange',
      params: {arrangeCode},
      method: 'get'
    })
  },

  /**
     *  恢复班次
     * @returns
     */
  recoverArrange: (arrangeCode) => {
    return request({
      url: '/manage/intercity/arrange/recoverArrange',
      params: {arrangeCode},
      method: 'get'
    })
  },

  /**
     *  删除
     * @returns
     */
  delete: (arrangeCode) => {
    return request({
      url: '/manage/intercity/arrange/delete',
      params: { arrangeCode },
      method: 'get'
    })
  },

  /**
     *  获取详细信息
     * @returns
     */
  getInfoById: (arrangeId) => {
    return request({
      url: '/manage/intercity/arrange/getInfoById',
      params: { arrangeId },
      method: 'get'
    })
  },

  /**
     *  创建班次
     * @returns
     */
  createArrange: (data) => {
    return request({
      url: '/manage/intercity/arrange/createArrange',
      data,
      method: 'post'
    })
  },

  /**
     *  指派班次司机
     * @returns
     */
  appointDriver: (data) => {
    return request({
      url: '/manage/intercity/arrange/appointDriver',
      data,
      method: 'post'
    })
  },

  /**
     *  取消班次司机
     * @returns
     */
  cancelAppointDriver: (arrangeCode) => {
    return request({
      url: '/manage/intercity/arrange/cancelAppointDriver',
      params: { arrangeCode }
    })
  },

  /**
     *  取消班次司机
     * @returns
     */
  getArrangePassengerList: (arrangeCode) => {
    return request({
      url: '/manage/intercity/arrange/getArrangePassengerList',
      params: { arrangeCode }
    })
  }
}
